using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Haso.Plantform.Entities.HR;

namespace Haso.Plantform.Configurations.HR
{
    /// <summary>
    /// 考勤记录Configuration
    /// </summary>
    public class AttendanceRecordConfiguration : EntityTypeConfiguration<AttendanceRecord>
    {
        public AttendanceRecordConfiguration()
        {
            this.HasKey(x => x.Id);
            this.Property(x => x.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            //建立主外键关系
            this.HasRequired(x => x.Employee).WithMany().HasForeignKey(x => x.EmployeId);
        }
    }
}
